Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: improve FlagDependencyExportsPlugin for large JSON by depth #8802

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hai-x
Copy link
Contributor

@hai-x hai-x commented Dec 21, 2024

Summary

Aligned with webpack/webpack#19058.

I will update doc later.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@CLAassistant
Copy link

CLAassistant commented Dec 21, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the release: performance release: performance related release(mr only) label Dec 21, 2024
Copy link

netlify bot commented Dec 21, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 3a0de8f
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6767b994f1fd910008e8b890

@hai-x hai-x force-pushed the hai-x/feat-support-dyn-exp-for-url branch from 84ce1e2 to cad432f Compare December 22, 2024 06:12
Copy link

codspeed-hq bot commented Dec 22, 2024

CodSpeed Performance Report

Merging #8802 will not alter performance

Comparing hai-x:hai-x/feat-support-dyn-exp-for-url (3a0de8f) with main (ed67e97)

Summary

✅ 1 untouched benchmarks

@LingyuCoder LingyuCoder requested a review from JSerFeng December 23, 2024 01:54
Copy link
Contributor

@ahabhgk ahabhgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me

@@ -13,13 +13,15 @@ pub struct JsonExportsDependency {
id: DependencyId,
#[cacheable(with=AsPreset)]
data: JsonValue,
exports_depth: f64,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exports_depth: f64,
exports_depth: u32,

u32 should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense.

@@ -32,7 +32,9 @@ mod utils;

#[cacheable]
#[derive(Debug)]
struct JsonParserAndGenerator;
struct JsonParserAndGenerator {
pub exports_depth: f64,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub exports_depth: f64,
pub exports_depth: u32,

D(
module.parser[JSON_MODULE_TYPE],
"exportsDepth",
mode === "development" ? 1 : Number.POSITIVE_INFINITY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mode === "development" ? 1 : Number.POSITIVE_INFINITY
mode === "development" ? 1 : Number.MAX_SAFE_INTEGER

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is Infinity in webpack. Should we align?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both is fine, but I'm not sure what will pass to rust side by napi-rs if we use Infinity here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants